package com.xbongbong.admin.domain.dao;

import com.xbongbong.admin.domain.entity.FormBindTemplateInfoEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @auther: xingxing.xiao
 * @date: 3/3/2020 22:11
 */
@Repository
@Mapper
public interface FormBindTemplateInfoDao {

    Integer insert(FormBindTemplateInfoEntity entity);

    Integer update(FormBindTemplateInfoEntity entity);

    List<FormBindTemplateInfoEntity> findEntitys(@Param("param") Map<String, Object> param);

    Integer getEntitysCount(@Param("param") Map<String, Object> param);

    FormBindTemplateInfoEntity getByKey(@Param("key") Long key);

    Integer deleteByKey(@Param("key") Long key);

    /**
     * 批量插入
     * @param list
     */
    Integer insertBatch(@Param("list") List<FormBindTemplateInfoEntity> list);

    FormBindTemplateInfoEntity getByTemplateId(@Param("templateId") Long templateId, @Param("type") Integer type);


    /**
     * 通过appid删除
     * @param appId
     * @param corpid
     * @return
     */
    Integer deleteByAppId(@Param("appId") Long appId,@Param("corpid")String corpid );

    Integer deleteByKeys(@Param("list") List<Long> keys,@Param("corpid") String corpid);

}
